<?php
include_once("../../globals.php");
include_once("$srcdir/api.inc");

$form_name = "telemedicina";
?>

<html><head>
        <?php html_header_show(); ?>
        <script type="text/javascript" src="<?php echo $GLOBALS['webroot']; ?>/library/js/jquery-1.10.0.min.js"></script>        
        <script type="text/javascript" src="<?php echo $GLOBALS['webroot']; ?>/library/js/jquery-ui-1.10.3.custom.min2.js"></script>

    </head>

    <body class="body_top">

        <form method=post action="<?php echo $rootdir . "/forms/" . $form_name . "/save.php?mode=new"; ?>" name="my_form" id="my_form">
            <div style="padding: 0px;" class="borde_normal">
                <p><span class="historial_paciente"><i style="font-size: 1.2em;" class="icon-desktop"></i> Telemedicina</span></p>
            </div>
            <p>Por favor seleccione su consultorio actual:</p>
            <select name='pc_consultorio' id='pc_consultorio'>
                <?php
                $cres = sqlStatement("SELECT * FROM `list_options` WHERE list_id = 'Consultorio_Cartagena' order by seq asc");
                while ($crow = sqlFetchArray($cres)) {
                    echo "       <option value='" . $crow['option_id'] . "'";
                    if ($crow['seq'] == $result['pc_condid'])
                        echo " selected ";
                    echo ">" . $crow['title'] . "</option>\n";
                }
                ?>
            </select>

            <div class="borde_normal">
                <button id="cancelar" onclick="" class="css_button" type="button"><i class="icon-remove-sign"></i> Cancelar</button>
                <button id="iniciar" onclick="" class="css_button" type="submit"><i class="icon-ok-sign"></i> Iniciar</button>
            </div>


        </form>

    </body>

    <script language="javascript">

        $(document).ready(function() {
            $("#iniciar").click(function() {
                window.open("http://"+$("#pc_consultorio").val(),'_blank');       
                parent.$.fancybox.close();
            });
            $("#cancelar").click(function() {
                parent.$.fancybox.close();
            });
        });

    </script>

</html>
